package br.ufpe.cin.ip.biblioteca.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.WindowConstants;

public class GerenciarRevistas extends JDialog {
	private static final long serialVersionUID = 5671659653963921702L;
	
	public GerenciarRevistas(JFrame owner) {
		super(owner, true);
		this.getContentPane().setLayout(null);
		
		JButton botaoCadastrar = new JButton("Cadastrar");
		botaoCadastrar.setBounds(50, 30, 180, 30);
		botaoCadastrar.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				new CadastrarRevista(GerenciarRevistas.this).setVisible(true);
			}
		});
		this.getContentPane().add(botaoCadastrar);
		
		JButton botaoRemover = new JButton("Remover");
		botaoRemover.setBounds(50, 75, 180, 30);
		botaoRemover.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				new RemoverRevista(GerenciarRevistas.this).setVisible(true);
			}
		});
		this.getContentPane().add(botaoRemover);
		
		JButton botaoBuscar = new JButton("Buscar");
		botaoBuscar.setBounds(50, 120, 180, 30);
		botaoBuscar.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				new BuscarRevista(GerenciarRevistas.this).setVisible(true);
			}
		});
		this.getContentPane().add(botaoBuscar);
		
		JButton botaoAtualizar = new JButton("Atualizar");
		botaoAtualizar.setBounds(50, 165, 180, 30);
		botaoAtualizar.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				new AtualizarRevista(GerenciarRevistas.this).setVisible(true);
			}
		});
		this.getContentPane().add(botaoAtualizar);
		
		this.setTitle("Gerenciar Livros - SysBiblio");
		this.setBounds(100, 100, 300, 270);
		this.setLocationRelativeTo(null);
		this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
	}
}
